%table.table.table-striped
  %tr
    %th Title
    %th Active?
    %th Max Clicks
    %th Clicks
    %th Max Impressions
    %th Impressions
    %th
    %th
    %th
  - @advertisements.each do |advertisement|
    %tr
      %td= advertisement.title
      %td= advertisement.is_active
      %td
        - if advertisement.max_clicks == 0 || advertisement.max_clicks == nil
          Unlimited
        - else
          = advertisement.max_clicks
      %td
        - if advertisement.clicks == []
          None
        -else
          = advertisement.clicks
      %td
        - if advertisement.max_impressions == 0 || advertisement.max_impressions == nil
          Unlimited
        - else
          = advertisement.max_impressions
      %td
        - if advertisement.impressions_count == []
          None
        -else
          = advertisement.impressions_count
      %td= link_to 'Show', advertisement
      %td= link_to 'Edit', edit_advertisement_path(advertisement)
      %td= link_to 'Destroy', advertisement, confirm: 'Are you sure?', method: :delete